package or;

import org.junit.jupiter.api.Test;


public class T0055 {
    public boolean canJump(int[] nums) {
        int right = 0;
        int len = nums.length;
        for (int i = 0; i < len; i++) {
            if (i>right)return false;
            right=Math.max(right,i+nums[i]);
        }
        return true;
    }


    @Test
    public void test() {
        int[] ints = {3, 2, 1, 0, 4};
        System.out.println(canJump(ints));
    }

}
